XeLaTeX has been added to the standard commands of Texmaker since the version 3.5.1. This blog shows how to use XeLaTeX in Texmaker with a simple example.
1. Use XeLaTeX in Texmaker
Menu --> Options --> Configure Texmaker --> Quick build --> Select 'XeLaTeX + View PDF',as shown in the following figure:
Fig. 1. Texmaker configuration
The Latin Modern fonts is defaulted by XeLaTeX, not covering Chinese. To display Chinese characters correctly, the font type should be assigned explicitly by using the command:
\usepackage{fontspec} %Advanced font selection in X∃LATEX and LuaLATEX
\setsansfont{<font name>}[<font options>]
Here is a simple example.
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{fontspec}
\setsansfont{Microsoft YaHei} %Microsoft YaHei Regular (don't include Regular )
% or use the filename
\setsansfont{msyh.ttc}
\title{标题}
\author{作者}
\date{}
\begin{document}
\begin{frame}[noframenumbering]
\titlepage
\end{frame}
\end{document}
PS: Check Windows available fonts by Start --> Run --> %windir%\fonts --> OK.
2. More about XeLaTeX
The following text is excerpted from the wikipedia XeTeX:
XeTeX (/ˈziːtɛx/ *zee-tekh*[1] or /ˈziːtɛk/) is a TeX typesetting engine using Unicode and supporting modern font technologies such as OpenType, Graphite) and Apple Advanced Typography (AAT).
XeLaTeX is a replacement for PDFLaTeX, it takes LaTeX input and turns it into a PDF. The major differences between latex/pdflatex and xelatex are[2]:
- xelatex assumes input is in UTF8 (which allows encoding of non-English and non-Latin characters) by default
- xelatex uses system fonts, not specially installed latex fonts
For more info, please reach out the official website http://www.tug.org/xetex/.
References:
[2] Using XeLaTeX